package com.hqd.ch03.v22.aop.framework;

public class ProxyConfig {
    /**
     * advise是否可见
     */
    boolean opaque = false;
    /**
     * 允许代理对象内部通过 AopContext 访问当前代理，适用于自调用场景
     */
    boolean exposeProxy = false;
    /**
     * 是否使用CGLIB代理
     */
    private boolean proxyTargetClass = false;
    /**
     * 代理配置是否被冻结，防止运行时修改
     */
    private boolean frozen = false;

    public boolean isProxyTargetClass() {
        return this.proxyTargetClass;
    }

    public void setProxyTargetClass(boolean proxyTargetClass) {
        this.proxyTargetClass = proxyTargetClass;
    }


    public boolean isOpaque() {
        return this.opaque;
    }

    public void setOpaque(boolean opaque) {
        this.opaque = opaque;
    }

    /**
     * Return whether the AOP proxy will expose the AOP proxy for
     * each invocation.
     */
    public boolean isExposeProxy() {
        return this.exposeProxy;
    }

    public void setExposeProxy(boolean exposeProxy) {
        this.exposeProxy = exposeProxy;
    }

    public boolean isFrozen() {
        return this.frozen;
    }

    public void setFrozen(boolean frozen) {
        this.frozen = frozen;
    }

    public void copyFrom(ProxyConfig other) {
        this.proxyTargetClass = other.proxyTargetClass;
        this.exposeProxy = other.exposeProxy;
        this.frozen = other.frozen;
        this.opaque = other.opaque;
    }
}
